package com.cuit.riskassessment.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cuit.riskassessment.dao.client.ClientMapper;
import com.cuit.riskassessment.service.ClientService;
import com.cuit.riskassessment.vo.Client;
@Service(value = "clientServiceObject")
public class ClientServiceImpl implements ClientService {
	@Autowired
	@Resource(name = "clientMapper")
	private ClientMapper mapper;
	
	@Override
	public int addOrUpdateClient(boolean flag, Client client) {
		if (flag) {
			return mapper.addClient(client);
		}
		return mapper.updateClient(client);
	}

	@Override
	public int delClient(int id) {
		return mapper.delClient(id);
	}

	@Override
	public List<Client> getAllClients() {
		return mapper.getAllClients();
	}

	@Override
	public List<Client> getClientByName(String name,String val) {
		// TODO Auto-generated method stub
		return mapper.getClientByName(name,val);
	}

}
